﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Domain.Entity
{
    [Serializable]
    public class Customer
    {
        public virtual long ID
        {
            get;
            set;
        }

        [Display(Name = "Title")]
        public virtual Title Title
        {
            get;
            set;
        }

        [Required]
        [Display(Name = "First Name")]
        public virtual string FirstName
        {
            get;
            set;
        }

        [Required]
        [Display(Name = "Last Name")]
        public virtual string LastName
        {
            get;
            set;
        }
        //public virtual string MiddleName
        //{
        //    get;
        //    set;
        //}

        [Display(Name = "Company Name")]
        public virtual string CompanyName
        {
            get;
            set;
        }
        //public virtual char Sex
        //{
        //    get;
        //    set;
        //}
        //public virtual DateTime DOB
        //{
        //    get;
        //    set;
        //}

        [Required]
        [Display(Name = "Address Line1")]
        public virtual string AddressLine1
        {
            get;
            set;
        }

        [Display(Name = "Address Line2")]
        public virtual string AddressLine2
        {
            get;
            set;
        }

        [Display(Name = "Address Line3")]
        public virtual string AddressLine3
        {
            get;
            set;
        }


        [Required]
        [Display(Name = "City")]
        public virtual string City
        {
            get;
            set;
        }

        
        public virtual string County
        {
            get;
            set;
        }

        [Display(Name = "Country")]
        public virtual Country Country
        {
            get;
            set;
        }

        [Required]
        [Display(Name = "Postcode")]
        public virtual string Postcode
        {
            get;
            set;
        }

        [RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", 
            ErrorMessage = "Please enter a valid e-mail adress")]
        [Required]
        [DataType(DataType.EmailAddress)]
        [Remote("EmailAvailable", "Customer", AdditionalFields = "InitialEmail")]
        public virtual string Email
        {
            get;
            set;
        }

        public virtual string InitialEmail
        {
            get;
            set;
        }
        //public virtual string HomePhone
        //{
        //    get;
        //    set;
        //}
        //public virtual string MobileNo
        //{
        //    get;
        //    set;
        //}
        //public virtual string WorkPhoneNo
        //{
        //    get;
        //    set;
        //}
        //public virtual string FaxNo
        //{
        //    get;
        //    set;
        //}

        public virtual DateTime CreatedDate
        {
            get;
            set;
        }


        public virtual int CreatedBy
        {
            get;
            set;
        }
        public virtual DateTime? UpdatedDate
        {
            get;
            set;
        }
        public virtual int UpdatedBy
        {
            get;
            set;
        }
        public virtual bool IsDeleted
        {
            get;
            set;
        }
    }
}
